More build config changes:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 10 Mar 2006 16:32:04 +0000 (17:32 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 10 Mar 2006 16:32:04 +0000 (17:32 +0100)
 - Build -O2 rather than -O3
 - Build with -Wstrict-prototypes
 - Move target-specific generic compiler switches to Config.mk

Signed-off-by: Keir Fraser <keir@xensource.com>
26 files changed:
Config.mk
tools/Rules.mk
tools/ioemu/target-i386-dm/Makefile
tools/ioemu/vl.h
tools/misc/lomount/lomount.c
tools/misc/mbootpack/Makefile
tools/misc/xc_shadow.c
tools/vtpm_manager/manager/Makefile
tools/xenmon/xenbaked.c
tools/xenstat/libxenstat/Makefile
tools/xenstat/libxenstat/src/xen-interface.c
tools/xenstat/libxenstat/src/xen-interface.h
tools/xenstat/libxenstat/src/xenstat.c
tools/xenstat/libxenstat/src/xenstat.h
tools/xenstore/xenstored_core.c
tools/xentrace/xentrace.c
xen/arch/x86/Rules.mk
xen/arch/x86/audit.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/i8259.c
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/common/lib.c
xen/include/asm-x86/hvm/io.h
xen/include/asm-x86/hvm/vpic.h
xen/include/xen/sched.h

index a7c975d2bc0c242ec52001dfcd5a92ade4b4aaae..7cea3953c5ddf1b8fcf099d789ecb2d08e7ca355 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -12,14 +12,6 @@ XEN_TARGET_X86_PAE  ?= n
 HOSTCC     = gcc
 HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 
-ifneq ($(debug),y)
-# Optimisation flags are overridable
-CFLAGS    ?= -O3 -fomit-frame-pointer
-CFLAGS    += -DNDEBUG
-else
-CFLAGS    += -g
-endif
-
 AS         = $(CROSS_COMPILE)as
 LD         = $(CROSS_COMPILE)ld
 CC         = $(CROSS_COMPILE)gcc
@@ -38,6 +30,22 @@ INSTALL_DIR  = $(INSTALL) -d -m0755
 INSTALL_DATA = $(INSTALL) -m0644
 INSTALL_PROG = $(INSTALL) -m0755
 
+ifneq ($(debug),y)
+# Optimisation flags are overridable
+CFLAGS    ?= -O2 -fomit-frame-pointer
+CFLAGS    += -DNDEBUG
+else
+CFLAGS    += -g
+endif
+
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+CFLAGS  += -m32 -march=i686
+endif
+
+ifeq ($(XEN_TARGET_ARCH),x86_64)
+CFLAGS  += -m64
+endif
+
 ifeq ($(XEN_TARGET_ARCH),x86_64)
 LIBDIR = lib64
 else
@@ -51,7 +59,7 @@ endif
 
 test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep -q " $(2) " && echo $(2))
 
-CFLAGS += -Wall
+CFLAGS += -Wall -Wstrict-prototypes
 
 HOSTCFLAGS += $(call test-gcc-flag,$(HOSTCC),-Wdeclaration-after-statement)
 CFLAGS     += $(call test-gcc-flag,$(CC),-Wdeclaration-after-statement)
index c52de4691540fd9f23ddea133478ef5c894ec5da..a2eeced638b4443c9e8647916222297dc35b0842 100644 (file)
@@ -10,16 +10,6 @@ XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
 XEN_LIBXENSTAT     = $(XEN_ROOT)/tools/xenstat/libxenstat/src
 
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-CFLAGS  += -m32 -march=i686
-LDFLAGS += -m32
-endif
-
-ifeq ($(XEN_TARGET_ARCH),x86_64)
-CFLAGS  += -m64
-LDFLAGS += -m64
-endif
-
 X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
 
 %.opic: %.c
index 3400621cefdcbf39a26f88a38f09746fa592ee0a..887f73bea8fd4c50a3dcbb0ddd5f6f7e666b12ac 100644 (file)
@@ -235,7 +235,7 @@ endif
 all: $(PROGS)
 
 $(QEMU_USER): $(OBJS)
-       $(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^  $(LIBS)
 ifeq ($(ARCH),alpha)
 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
 # the address space (31 bit so sign extending doesn't matter)
@@ -311,7 +311,7 @@ endif
 endif
 
 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
-       $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
+       $(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
 
 vnc.o: vnc.c keyboard_rdesktop.c
        $(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
index 2b30dc8f267c6b96a6410b0bca04188a46f05cc2..439c530d48ac9c6c91b4c20de4d6f713f48fc069 100644 (file)
@@ -697,7 +697,7 @@ void lance_init(NetDriverState *nd, int irq, uint32_t leaddr, uint32_t ledaddr);
 void tcx_init(DisplayState *ds, uint32_t addr);
 
 /* sched.c */
-void sched_init();
+void sched_init(uint32_t, uint32_t);
 
 /* magic-load.c */
 void magic_init(const char *kfn, int kloadaddr, uint32_t addr);
@@ -799,7 +799,7 @@ void readline_start(const char *prompt, int is_password,
 
 int gdbserver_start(int port);
 void update_select_wakeup_events(void);
-void tun_receive_handler();
+void tun_receive_handler(fd_set *);
 
 extern char domain_name[];
 #endif /* VL_H */
index b72f77da0361af8e2c2c9359809ede4ec8b38a61..85e5f3b584a552c9e47d35efcfe5cc8c854a8405 100644 (file)
@@ -195,7 +195,7 @@ done:
        return fail;
 }
 
-void usage()
+void usage(void)
 {
        fprintf(stderr, "You must specify at least -diskimage and -partition.\n");
        fprintf(stderr, "All other arguments are passed through to 'mount'.\n");
index 3c6791e4ee6f2d5c3c2ea6ed2585e2b671a643ea..d1e3334bf787358d506308d38440b0d5b0ae8e79 100644 (file)
@@ -31,7 +31,7 @@ DEPFLAGS = -Wp,-MD,.$(@F).d
 DEPS     = .*.d
 
 mbootpack: $(OBJS)
-       $(HOSTCC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
+       $(HOSTCC) -o $@ $(filter-out %.a, $^)
 
 clean:
        $(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
index 20363637bf0c57ae02dd50c7676857274d3a5085..83c52ebc19ba6b8a21718b54d7096e52e5d2ca94 100644 (file)
@@ -18,7 +18,7 @@
 #include <errno.h>
 #include <string.h>
 
-void usage()
+void usage(void)
 {
     printf("xc_shadow: -[0|1|2]\n");
     printf("    set shadow mode\n");
@@ -28,7 +28,7 @@ void usage()
 int main(int argc, char *argv[])
 {
     int xc_handle;
-    int mode;
+    int mode = 0;
 
     if ( argc > 1 )
     {
index e6f20f5a5e0e52ab11769e3586846d701eb232e4..278a37e963ef0622bbc65fef1f3b0dd46e09277a 100644 (file)
@@ -20,7 +20,7 @@ mrproper: clean
        rm -f $(BIN) *~
 
 $(BIN): $(OBJS)
-       $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+       $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
 
 # libraries
 LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
index 1289e474253bbaa4159e28244eb3a6b64dbef010..a7cd4be2d0ad3e252d786ab1dc6459c00ce48d34 100644 (file)
@@ -379,7 +379,7 @@ struct t_rec **init_rec_ptrs(struct t_buf **meta, unsigned int num)
 /**
  * get_num_cpus - get the number of logical CPUs
  */
-unsigned int get_num_cpus()
+unsigned int get_num_cpus(void)
 {
     dom0_op_t op;
     int xc_handle = xc_interface_open();
@@ -409,7 +409,7 @@ unsigned int get_num_cpus()
 /**
  * monitor_tbufs - monitor the contents of tbufs
  */
-int monitor_tbufs()
+int monitor_tbufs(void)
 {
     int i;
     extern void process_record(int, struct t_rec *);
index d874ba3af1f600c13fc3e8796fc410f394e302a8..52832017ff9e058e970e02c476a899473b5858a8 100644 (file)
@@ -48,7 +48,7 @@ $(LIB): $(OBJECTS)
        $(RANLIB) $@
 
 $(SHLIB): $(OBJECTS)
-       $(CC) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
+       $(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS)
 
 src/xenstat.o: src/xenstat.c src/xenstat.h src/xen-interface.h
        $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
index 6b6fa6b9fbfbded631e2793673dc2257f2098d5a..59723157ad4769470f3c40b91fe29a5821acec12 100644 (file)
@@ -31,7 +31,7 @@ struct xi_handle {
 
 /* Initialize for xen-interface.  Returns a handle to be used with subsequent
  * calls to the xen-interface functions or NULL if an error occurs. */
-xi_handle *xi_init()
+xi_handle *xi_init(void)
 {
        xi_handle *handle;
 
index c1e74edcd6a5314f8dc8bb874c0353dea64b1f2a..fc7119ae345dbc4f966b8991466f6e043fefa85e 100644 (file)
@@ -26,7 +26,7 @@ typedef struct xi_handle xi_handle;
 
 /* Initialize for xen-interface.  Returns a handle to be used with subsequent
  * calls to the xen-interface functions or NULL if an error occurs. */
-xi_handle *xi_init();
+xi_handle *xi_init(void);
 
 /* Release the handle to libxc, free resources, etc. */
 void xi_uninit(xi_handle *handle);
index e8a6928dac194f6fb3eeada55a47b59b17a3af2f..3332f2cad71bfde39c88a9d698d00cb6ca8a8dce 100644 (file)
@@ -129,7 +129,7 @@ static xenstat_collector collectors[] = {
 /*
  * libxenstat API
  */
-xenstat_handle *xenstat_init()
+xenstat_handle *xenstat_init(void)
 {
        xenstat_handle *handle;
 
index b9ac1d3782613b458c76541940dec87272092531..90676e87630670e921a06dbea2828d2b078b8bec 100644 (file)
@@ -26,7 +26,7 @@ typedef struct xenstat_network xenstat_network;
 
 /* Initialize the xenstat library.  Returns a handle to be used with
  * subsequent calls to the xenstat library, or NULL if an error occurs. */
-xenstat_handle *xenstat_init();
+xenstat_handle *xenstat_init(void);
 
 /* Release the handle to libxc, free resources, etc. */
 void xenstat_uninit(xenstat_handle * handle);
index b23aa40fa5382f003c4b1ae634297d6f5232ed3a..bfa71f56bd174104a8694bebd9e9ee5e58c906c3 100644 (file)
@@ -66,7 +66,7 @@ static char *tracefile = NULL;
 static TDB_CONTEXT *tdb_ctx;
 
 static void corrupt(struct connection *conn, const char *fmt, ...);
-static void check_store();
+static void check_store(void);
 
 #define log(...)                                                       \
        do {                                                            \
@@ -238,7 +238,7 @@ static void trigger_reopen_log(int signal __attribute__((unused)))
 }
 
 
-static void reopen_log()
+static void reopen_log(void)
 {
        if (tracefile) {
                if (tracefd > 0)
@@ -1612,7 +1612,7 @@ static void clean_store(struct hashtable *reachable)
 }
 
 
-static void check_store()
+static void check_store(void)
 {
        char * root = talloc_strdup(NULL, "/");
        struct hashtable * reachable =
index 2780e1dbb2249a959b27c2cfcb7bac43e8908aa4..34b2a6a64945e1108bbc3b4cbcaaf627d58ad701 100644 (file)
@@ -258,7 +258,7 @@ struct t_rec **init_rec_ptrs(struct t_buf **meta, unsigned int num)
 /**
  * get_num_cpus - get the number of logical CPUs
  */
-unsigned int get_num_cpus()
+unsigned int get_num_cpus(void)
 {
     dom0_op_t op;
     int xc_handle = xc_interface_open();
index 66cddd1577825f145655fd14e22efa2b2002d728..3921119034ba2076da876554e290b12dd6462018 100644 (file)
@@ -22,19 +22,20 @@ CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
 CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector)
 CFLAGS  += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
 
-ifeq ($(TARGET_SUBARCH),x86_32)
-CFLAGS  += -m32 -march=i686
-LDFLAGS += -m elf_i386 
-ifeq ($(pae),y)
+ifeq ($(TARGET_SUBARCH)$(pae),x86_32y)
 CFLAGS  += -DCONFIG_X86_PAE=1
 endif
-endif
+
 ifeq ($(supervisor_mode_kernel),y)
 CFLAGS  += -DCONFIG_X86_SUPERVISOR_MODE_KERNEL=1
 endif
 
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+LDFLAGS += -m elf_i386 
+endif
+
 ifeq ($(TARGET_SUBARCH),x86_64)
-CFLAGS  += -m64 -mno-red-zone -fpic -fno-reorder-blocks
+CFLAGS  += -mno-red-zone -fpic -fno-reorder-blocks
 CFLAGS  += -fno-asynchronous-unwind-tables
 LDFLAGS += -m elf_x86_64
 endif
index b0bba0daa3ce3768cad6dbb827a9a384be2c27b0..b64f4e880db1e2a8a6e78ffa54f0111f8c3af594 100644 (file)
@@ -350,7 +350,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
         unmap_domain_page(pt);
     }
 
-    void adjust_shadow_tables()
+    void adjust_shadow_tables(void)
     {
         struct shadow_status *a;
         unsigned long smfn, gmfn;
@@ -402,7 +402,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
         }
     }
 
-    void adjust_oos_list()
+    void adjust_oos_list(void)
     {
         struct out_of_sync_entry *oos;
 
@@ -426,7 +426,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
         }
     }
 
-    void adjust_for_pgtbase()
+    void adjust_for_pgtbase(void)
     {
         struct vcpu *v;
 
@@ -443,7 +443,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
         }
     }
 
-    void adjust_guest_pages()
+    void adjust_guest_pages(void)
     {
         struct list_head *list_ent = d->page_list.next;
         struct page_info *page;
index e9669983d45169bc41c2970a0821427321592ad1..c3f3318d40b0ebe28a6a96de03450a2364584d77 100644 (file)
@@ -205,12 +205,10 @@ void hvm_setup_platform(struct domain* d)
     }
 }
 
-void pic_irq_request(int *interrupt_request, int level)
+void pic_irq_request(void *data, int level)
 {
-    if (level)
-        *interrupt_request = 1;
-    else
-        *interrupt_request = 0;
+    int *interrupt_request = data;
+    *interrupt_request = level;
 }
 
 void hvm_pic_assist(struct vcpu *v)
index 7bfb0078658f322cf241989569dded843fb6b651..3426342793cb8159ff8fc3b62adb636051068b08 100644 (file)
@@ -407,7 +407,7 @@ static void pic_init1(int io_addr, int elcr_addr, PicState *s)
     pic_reset(s);
 }
 
-void pic_init(struct hvm_virpic *s, void (*irq_request)(), 
+void pic_init(struct hvm_virpic *s, void (*irq_request)(void *, int),
               void *irq_request_opaque)
 {
     memset(s, 0, sizeof(*s));
@@ -422,7 +422,8 @@ void pic_init(struct hvm_virpic *s, void (*irq_request)(),
     return; 
 }
 
-void pic_set_alt_irq_func(struct hvm_virpic *s, void (*alt_irq_func)(),
+void pic_set_alt_irq_func(struct hvm_virpic *s,
+                          void (*alt_irq_func)(void *, int, int),
                           void *alt_irq_opaque)
 {
     s->alt_irq_func = alt_irq_func;
index ce0e8031ebaba7709cec6becf4e814e2b93a364e..e612c1035d2645e0b4612e13fc7ebe06f816bc8b 100644 (file)
@@ -363,7 +363,7 @@ static inline int construct_init_vmcs_guest(cpu_user_regs_t *regs)
     return error;
 }
 
-static inline int construct_vmcs_host()
+static inline int construct_vmcs_host(void)
 {
     int error = 0;
 #ifdef __x86_64__
index 77310e5146e74be3ad53bd717a5231057738635c..ac169265f410b6d403dd22715a4402b040f1046b 100644 (file)
@@ -479,12 +479,13 @@ void vmx_init_ap_context(struct vcpu_guest_context *ctxt,
 
 void do_nmi(struct cpu_user_regs *);
 
-static int check_vmx_controls(ctrls, msr)
+static int check_vmx_controls(u32 ctrls, u32 msr)
 {
     u32 vmx_msr_low, vmx_msr_high;
 
     rdmsr(msr, vmx_msr_low, vmx_msr_high);
-    if (ctrls < vmx_msr_low || ctrls > vmx_msr_high) {
+    if ( (ctrls < vmx_msr_low) || (ctrls > vmx_msr_high) )
+    {
         printk("Insufficient VMX capability 0x%x, "
                "msr=0x%x,low=0x%8x,high=0x%x\n",
                ctrls, msr, vmx_msr_low, vmx_msr_high);
index 1eb70fe6c4b3320e74a3310c88e30541b19afd11..408e8eefe6125ab28e082f139bca1e561156ccf4 100644 (file)
@@ -158,8 +158,7 @@ shl(register digit *p, register int len, register int sh)
  * leading zeros).
  */
 u64
-__qdivrem(uq, vq, arq)
-       u64 uq, vq, *arq;
+__qdivrem(u64 uq, u64 vq, u64 *arq)
 {
        union uu tmp;
        digit *u, *v, *q;
@@ -382,8 +381,7 @@ __divdi3(s64 a, s64 b)
  * Divide two unsigned quads.
  */
 u64
-__udivdi3(a, b)
-        u64 a, b;
+__udivdi3(u64 a, u64 b)
 {
 
         return (__qdivrem(a, b, (u64 *)0));
index 224f22cc4a6d56af7f47194385fe97411b0282b5..6992a4ffeb964ef46e871fb356373f5b646d275d 100644 (file)
@@ -151,7 +151,7 @@ extern void handle_mmio(unsigned long, unsigned long);
 extern void hvm_wait_io(void);
 extern void hvm_safe_block(void);
 extern void hvm_io_assist(struct vcpu *v);
-extern void pic_irq_request(int *interrupt_request, int level);
+extern void pic_irq_request(void *data, int level);
 extern void hvm_pic_assist(struct vcpu *v);
 extern int cpu_get_interrupt(struct vcpu *v, int *type);
 extern int cpu_has_pending_irq(struct vcpu *v);
index 57388119af4669b8cacc12b0d08e158843719cf9..a46507ca6bdd217cb0e1841b44f2232fd27ca7a2 100644 (file)
@@ -55,7 +55,7 @@ struct hvm_virpic {
     /* 0 is master pic, 1 is slave pic */
     /* XXX: better separation between the two pics */
     PicState pics[2];
-    void (*irq_request)(int *opaque, int level);
+    void (*irq_request)(void *opaque, int level);
     void *irq_request_opaque;
     /* IOAPIC callback support */
     void (*alt_irq_func)(void *opaque, int irq_num, int level);
@@ -66,10 +66,10 @@ struct hvm_virpic {
 void pic_set_irq(struct hvm_virpic *s, int irq, int level);
 void pic_set_irq_new(void *opaque, int irq, int level);
 void pic_init(struct hvm_virpic *s, 
-              void (*irq_request)(),
+              void (*irq_request)(void *, int),
               void *irq_request_opaque);
 void pic_set_alt_irq_func(struct hvm_virpic *s, 
-                          void(*alt_irq_func)(),
+                          void (*alt_irq_func)(void *, int, int),
                           void *alt_irq_opaque);
 int pic_read_irq(struct hvm_virpic *s);
 void pic_update_irq(struct hvm_virpic *s);
index e8348f48aee5384b0829010a663a40abc2987d0f..3b3e8389ff9bd76a4173a2ee28cb249d8b44b9ad 100644 (file)
@@ -266,7 +266,7 @@ void sched_add_domain(struct vcpu *);
 void sched_rem_domain(struct vcpu *);
 long sched_ctl(struct sched_ctl_cmd *);
 long sched_adjdom(struct sched_adjdom_cmd *);
-int  sched_id();
+int  sched_id(void);
 void vcpu_wake(struct vcpu *d);
 void vcpu_sleep_nosync(struct vcpu *d);
 void vcpu_sleep_sync(struct vcpu *d);